<%@ page language="java" import="com.sap.mw.jco.IFunctionTemplate" pageEncoding="UTF-8" %>
<%@ page import="com.sap.mw.jco.JCO" %>
<%@ page import="com.weaver.integration.datesource.SAPInterationOutUtil" %>
<%@ page import="com.weaver.integration.log.LogInfo" %>
<%@ page import="weaver.common.DateUtil" %>
<%--流程退回调用QMS接口--%>
<%
    try {
        String curdate = DateUtil.getFullDate();
        String tablename = "uf_kmzsj";
        out.println(">>>>>WeaSyncKmzsjCronJob>>>>>curdate=" + curdate+"<br/>");
        SAPInterationOutUtil outUtil = new SAPInterationOutUtil();
        JCO.Client myConnection = (JCO.Client) outUtil.getConnection("1", new LogInfo());
        myConnection.connect();
        // 实例名
        JCO.Repository myRepository = new JCO.Repository("Repository", myConnection);
        //设置BAPI函数
        IFunctionTemplate ft = myRepository.getFunctionTemplate("ZFI_GET_ACCOUNT");
        JCO.Function bapi = ft.getFunction();
        //输入参数和结构处理
        JCO.ParameterList input = bapi.getImportParameterList();
        input.setValue("Z117", "BUKRS");
        //执行函数
        myConnection.execute(bapi);
        //输出参数和结构处理
        //JCO.ParameterList outPrint = bapi.getExportParameterList();
        //输出表的处理
        JCO.ParameterList Table00 = bapi.getTableParameterList();
        //返回处理结果以及日志
        JCO.Table t = Table00.getTable("OUTPUT");
        int totalCount = t.getNumRows();
        out.println(">>>>>WeaSyncKmzsjCronJob>>>>>totalCount=" + totalCount+"<br/>");
        for (int i = 0; i < totalCount; i++) {
            t.setRow(i);
            String saknr = (String) t.getValue("SAKNR");
            String txt50 = (String) t.getValue("TXT50");
            String txt20 = (String) t.getValue("TXT20");
            String mcod1 = (String) t.getValue("MCOD1");
            String ktoks = (String) t.getValue("KTOKS");
            out.println(">>>>>WeaSyncKmzsjCronJob>>>>>saknr=" + saknr
                    +",txt50="+txt50+",txt20="+txt20+",mcod1="+mcod1+",ktoks="+ktoks+"<br/>");
        }
    } catch (Exception e) {
        out.println("WeaSyncKmzsjCronJob" + e);
        e.printStackTrace();
    }
%>




